package com.crm.controller;

import com.crm.dto.ClueGainDto;
import com.crm.result.CluePage;
import com.crm.result.PageResultTow;
import com.crm.result.Result;
import com.crm.service.FakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 线索池伪线索相关接口
 */
@RestController
public class FakeController {
    @Autowired
    private FakeService fakeService;
    /**
     * 分页查询线索列表
     */
    @GetMapping("/clues/clue/pool")
    public PageResultTow getClueList(@ModelAttribute CluePage cluePage) {
        PageResultTow clueListByPage = fakeService.getFakePoolByPage(cluePage);
        return clueListByPage;
    }
    /**
     * 伪线索捞取
     */
    @PutMapping("/clues/clue/gain")
    public Result putGain(@RequestBody ClueGainDto clueGainDto){
        fakeService.putGain(clueGainDto);
        return Result.success();
    }
}
